<!-- player scripts -->  
<script FOR="WMP" EVENT="NewStream()" LANGUAGE="JScript">
	try {
	     
	} catch (ex) { window.status=ex.message }
</script>
<script FOR="MediaPlayer" EVENT="Error( )" LANGUAGE="JScript">
	try {
		msg="Media FAILED to load";
		wmpstatus.innerHTML =   msg;
	} catch (ex) { window.status=ex.message }
</script>
<script FOR="WMP" EVENT="EndOfStream(lResult)" LANGUAGE="JScript"> 
	showstatus ("EndOfStream...");
	try {
		var d = MM_findObj,D=d("Dx"),C=d("continous");
		if (CONTINUOUS=="1") {
			showstatus ("Next clip...");
			fb_edit ('f',<?= $f+1 ?>,'s',D.scrollLeft,'t',D.scrollTop,'w',D.offsetWidth,'cc', '1');
		}  showstatus ("Stopped");
	} catch (ex) { window.status=ex.message }
</script>
<script FOR="WMP" EVENT="PlayStateChange(lOldState, lNewState)" LANGUAGE="JScript">  
	try {
		if (lNewState==0) {
		    msg="Stopped";
		} else if (lNewState==1) {
		    msg="Paused";
			showstatus ("Player paused...");
		} else if (lNewState==2) {
		    msg="Playing";
			if (lOldState==3) { 
				 SetWMPSlider ();
				 var d=MM_findObj,X=d("Dx"),W=d("WMP");  
				 if (VIEWMODE!="") {
					X.style.height = document.body.offsetHeight - ((infotable.offsetHeight+docy(infotable))+10); 
					X.style.border = "solid 1px gray"; 
					W.style.border = W.offsetHeight>10?"solid 1px gray":"none"; 
					 
					if (PLAYERMUTE==1) W.Mute = true;
					 
				 } 
			}
			hidestatus();
		} else if (lNewState==3) {
		    msg="Buffering...";
			showstatus ("Buffering...");
		} else msg=lNewState;
		wmpstatus.innerHTML = msg;
	} catch (ex) { showstatus(ex.message,'slateblue') }
</script>
 
<script language="javascript"> 
var PLAYERMUTE = "<?= $mm ?>";
function SetWMPSlider () {
	try {
	   if(document.all) {
			var P = WMP.CurrentPosition;
			var D = WMP.Duration;
			var R = P/D;
			// dprogpic.style.width = WMP.offsetWidth;
			progpic.width=dprogpic.offsetWidth*R;
			wmpstatus.innerHTML = secs(P)+"/<font color=gray>"+secs(D)+"</font>";
		} else {
		   MM_findObj("playercontrols").style.display="none";
		}
	} catch (ex) { window.status=ex.message }
	window.setTimeout ("SetWMPSlider ()", 1000);
} 
function secs (i) {
   var hh=parseInt(i/3600);
   var mm=parseInt((i-(hh*3600))/60);
   var ss=parseInt(i-((hh*3600)+(mm*60)));
   hh=hh<10?"0"+hh:hh;
   mm=mm<10?"0"+mm:mm;
   ss=ss<10?"0"+ss:ss;
   if(hh>0) return hh+":"+mm+":"+ss;
   return mm+":"+ss;
}
function slidermove(a) {
    var d = MM_findObj,D=d("dprogpic"),x=docx(D);
	var T = WMP.Duration;
	var X = window.event.x; 
	var E = event.srcElement; 
	if (E.id.indexOf("rogpic")>0) {
	   var mx=(X-x)/D.offsetWidth;
	   WMP.CurrentPosition = T*mx;
	}  else window.status = E.id
}
function slidertitle(a) {
    var d = MM_findObj,D=d("dprogpic"),x=docx(D);
	var T = WMP.Duration;
	var X = window.event.x; 
	var E = event.srcElement; 
	if (E.id.indexOf("rogpic")>0) {
	   var mx=(X-x)/D.offsetWidth;
	   E.title = secs(T*mx);
	}  else window.status = E.id
}
function RepositionTrack(a) {
	WMP.CurrentPosition += parseInt(a);	
} 
function setContinuous() {
    var d = MM_findObj,C=d("l_ct");
    CONTINUOUS = CONTINUOUS=="1"?"":"1";
	if (C) C.style.backgroundColor=CONTINUOUS=="1"?"#FFFFFF":"#CCCCFF"; 
	addglobal ("cc", CONTINUOUS);
} 
function setMute() {
    var d = MM_findObj,C=d("l_mt");
    PLAYERMUTE = WMP.Mute?"1":"";
	if (C) C.style.backgroundColor=PLAYERMUTE=="1"?"#FFFFFF":"#CCCCFF"; 
	addglobal ("mm", PLAYERMUTE);
} 
if (document.all) {
	document.body.attachEvent ("onmousedown", slidermove);
	document.body.attachEvent ("onmousemove", slidertitle); 
}	else SetWMPSlider (); 
</script>